package shangJi_1;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Computer resultAdd = new ComputerAdd().getResult();
        Computer resultJian = new ComputerJian().getResult();
        Computer resultCheng = new ComputerCheng().getResult();
        Computer resultChu = new ComputerChu().getResult();
        Computer resultMo = new ComputerMo().getResult();
        Scanner input=new Scanner(System.in);
        System.out.print("请输入第一个参数:");
        int num1 = input.nextInt();
        System.out.print("请输入运算符:");
        String next = input.next();
        System.out.print("请输入第二个参数:");
        int num2= input.nextInt();
        double result=0;
        switch (next){
            case "+":
                 result = resultAdd.result(num1, num2);
                break;
            case "-":
                result = resultJian.result(num1,num2);
                break;
            case "*":
                result = resultCheng.result(num1,num2);
                break;
            case "/":
                result = resultChu.result(num1,num2);
                break;
            case "%":
                result = resultMo.result(num1,num2);
                break;
            default:
                System.out.println("您输入的运算符有误");
                return;
        }
        System.out.println("结果为:"+result);

    }
}
